<!DOCTYPE html>
<html lang="en" ng-app ="smartOlwApp">
<head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<title>Departamento</title>
		<link rel="stylesheet" type="text/css" href="../../css/smart_icons_styles.css">
	  	<link rel="stylesheet" type="text/css" href="../../css/smart_menu.css">
	  	<link rel="stylesheet" type="text/css" href="../../css/smart_general.css">
	  	<link rel="stylesheet" type="text/css" href="../../css/smart_tabladatos.css">
	  	
	  	<link rel="stylesheet" type="text/css" href="../../js/ngdialog-0.2.3/ngDialog.css">
	  	<link rel="stylesheet" type="text/css" href="../../js/ngdialog-0.2.3/ngDialog-theme-default.css">
		<link rel="stylesheet" type="text/css" href="../../js/ngdialog-0.2.3/ngDialog-theme-plain.css">
	  	
        <!-- Importarmos angular JS -->
        <script type="text/javascript" src="../../js/jquery/jquery-1.8.3.min.js"></script>
    	<script type="text/javascript" src="../../js/main/template.js"></script>
    	<script type="text/javascript" src="../../js/angular-1.4.7/angular.min.js"></script>
    	<script type="text/javascript" src="../../js/ngdialog-0.2.3/ngDialog.min.js"></script> 
    	<script type="text/javascript" src="../../js/angucomplete/angucomplete.js"></script> 
    	
    	<!-- importar script para las funciones del formulario -->
    	<!-- >
    	<script type="text/javascript" src="script/departamento_app.js"></script>
    	<script type="text/javascript" src="script/departamento_services.js"></script>
		<script type="text/javascript" src="script/departamento_controller.js"></script>
		-->
		<script type="text/javascript" src="../smart_maestros/script/maestro_app.js"></script>
		<script type="text/javascript" src="../smart_maestros/script/maestro_service.js"></script>
    	<script type="text/javascript" src="script/departamento_controller.js"></script>
		
</head>
<body ng-controller = "departamentoCtrl">
	<div id="frame">
		<div class="panel panel-primary ng-scope">
			<div class="panel-heading">Departamento
		 		<a href="#"><span class="img"><img src="../../imagene/eliminar.png" style="float:right;"  ng-click="eliminar()" title = "Eliminar departamento"></span></a>
		 		<a href="#"><span class="img"><img src="../../imagene/limpiar.png" style="float:right;"   ng-click="limpiar()" title= "Limpiar"></span></a>
		 		<a href="#"><span class="img"><img src="../../imagene/consultar.png" style="float:right;" ng-click="consultar()" title= "Consultar departamento"></span></a>
		 		<a href="#"><span class="img"><img src="../../imagene/guardar.png" style="float:right;"   ng-click="grabar()" title= "Guardar departamento"></span></a>
		 	</div>
			<div class="panel-body">
				<input id="scdepartamento" type="text" class="texto" ng-model="scdepartamento" style = "display:none;">
               
                <div class = "alert alert-danger alert-dismissable" id="messageBox">
                	<h4>{{titulo_mensajes}}</h4> {{descripcion_mensajes}}
                	<a href="#"><span class="imagen"><img src="../../imagene/bombilla-incandescente32.png"  ng-click="showModal()"></span></a>
				</div>
				
				<div class="col-md-10 panel panel-primary ng-scope"  style="height: 80px;">
					<table style="width:100%; vertical-align: middle;">
						<tr style = "vertical-align: middle;">
							<td style="width:25%; vertical-align: middle;">
								<label  class="label">País*</label><br/>
								<select id="pais" class="seleccion" ng-model="mpais" ng-options="option.dspais for option in paises" ng-change="consultar()"></select>
							</td>
							<td width="25%" height="100%">
								<label class="label" for="Nombre">Código*</label><br/>	
								<input id="codepartamento" type="text" ng-keypress="filterValue($event)" class="texto" ng-model="codepartamento">
							</td>	
							<td width="25%" height="100%">
								<label class="label" >Nombre*</label><br/>	
								<input id="dsdepartamento" type="text" class="texto" ng-model="dsdepartamento">
							</td>		
						</tr>
					</table>
				</div>
					
				<div class="container">				
					<table class = "tabledatos">
						<thead>
							<tr>
								<th style="width: 150px;" scope="col" >País</th>
								<th style="width: 250px;" scope="col" >Código departamento</th>
								<th style="width: 350px;" scope="col" >Nombre departamento</th>
								<th style="width: 50px;" scope="col" >Acción</th>
							</tr>
						</thead>
						
						<tbody class="tbody">
							<tr ng-show="departamentos.length == 0">
								<th colspan="5" style="text-align:center;">No se encontraron departamentos al país seleccionado</th>
							</tr>
							<tr ng-repeat="d in departamentos | orderBy : 'dsdepartamento'">
							    <td style = "display:none;">{{d.scdepartamento}}</td>
							    <td style = "display:none;">{{d.fhingreso}}</td>
								<td style="width: 150px;">{{d.scpais.dspais}}</td>
								<td style="width: 250px;">{{d.codepartamento}}</td>
								<td style="width: 350px;">{{d.dsdepartamento}}</td>		
								<td class="botonera-table" style="width: 50px;"><a href="#"><span class="img"><img src="../../imagene/verifique-signo24.png" style="float:center;" ng-click="seleccionar(d)" title ="Editar"></span></a></td>						
							</tr>
						</tbody>
					</table>
				</div>
			</div>
		</div> 
	</div>
</body>
</html>